package core.product.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.CascadeType;

import core.profile.model.BasicProfile;

@Entity
@Table(name="productowner")
public class ProductOwner implements Serializable
{
	private static final long serialVersionUID = -8767337896773261247L;
	private Long uuid;
	private BasicProfile owner ;
	private String ownerDetail ;
	private Product product ;
	// the value could be {"Owner" or "Manager"}
	private String managedBy ;
	
	@Id
	@GeneratedValue
	@Column(name="uuid")
	public Long getUuid() {
		return uuid;
	}
	public void setUuid(Long uuid) {
		this.uuid = uuid;
	}
	@ManyToOne(cascade = CascadeType.ALL)
	public BasicProfile getOwner() {
		return owner;
	}
	public void setOwner(BasicProfile owner) {
		this.owner = owner;
	}
	@ManyToOne(cascade = CascadeType.ALL)
	public Product getProduct() {
		return product;
	}
	public void setProduct(Product product) {
		this.product = product;
	}
	@Column(name="ownerdetail",length=9000)
	public String getOwnerDetail() {
		return ownerDetail;
	}
	public void setOwnerDetail(String ownerDetail) {
		this.ownerDetail = ownerDetail;
	}
	@Column(name="managedby")
	public String getManagedBy() {
		return managedBy;
	}
	public void setManagedBy(String managedBy) {
		this.managedBy = managedBy;
	}
	

}
